import fetch from 'utils/fetch';
/**
 * 学校管理
 */
//查询所有省
export function queryAllProvince() {
    const params = {

    };
    return fetch({
        url: '/school/queryAllProvince',
        method: 'get',
        params
    });
}
//查询所有市
export function queryAllCityByProvinceId(provinceId) {
    const params = {
        provinceId
    };
    return fetch({
        url: '/school/queryAllCityByProvinceId',
        method: 'get',
        params
    });
}
//查询所有区
export function queryAllAreaByCityId(cityId) {
    const params = {
        cityId
    };
    return fetch({
        url: '/school/queryAllAreaByCityId',
        method: 'get',
        params
    });
}
//查询所有学校类型
export function querySchoolType() {
    const params = {

    };
    return fetch({
        url: '/school/querySchoolType',
        method: 'get',
        params
    });
}
//根据名称模糊查询科目
export function querySubjectByName(subjectName) {
    const data = {
        subjectName
    };
    return fetch({
        url: '/school/querySubjectByName',
        method: 'post',
        data
    });
}
//根据名称模糊查询学校名称
export function querySchoolByName(schoolName) {
    const data = {
        schoolName
    };
    return fetch({
        url: '/school/querySchoolByName',
        method: 'post',
        data
    });
}
//添加学校
export function addSchool(schoolLevel, parentSchoolId, periodId, periodName, schoolName, schoolType, schoolYear,
    provinceId, cityId, areaId, detail, realName, phone, subjectId) {
    const data = {
        schoolLevel,
        parentSchoolId,
        periodId,
        periodName,
        schoolName,
        schoolType,
        schoolYear,
        provinceId,
        cityId,
        areaId,
        detail,
        realName,
        phone,
        subjectId,
    };
    return fetch({
        url: '/school/addSchool',
        method: 'post',
        data
    });
}
//开启或关闭短信功能
export function startOrCloseMessage(status, schoolId) {
    const data = {
        status,
        schoolId
    };
    return fetch({
        url: '/school/startOrCloseMessage',
        method: 'post',
        data
    });
}
//科目详情
export function subjectDetail(schoolId) {
    const params = {
        schoolId
    };
    return fetch({
        url: '/school/subjectDetail',
        method: 'get',
        params
    });
}
//修改学校
export function modifySchool(schoolId, userId, schoolLevel, parentSchoolId, periodId, periodName, schoolName, schoolType, schoolYear, provinceId, cityId, areaId, detail) {
    const data = {
        schoolId,
        userId,
        schoolLevel,
        parentSchoolId,
        periodId,
        periodName,
        schoolName,
        schoolType,
        schoolYear,
        provinceId,
        cityId,
        areaId,
        detail
    };
    return fetch({
        url: '/school/modifySchool',
        method: 'post',
        data
    });
}
//查询学校负责人
export function querySchoolOwner(schoolId) {
    const params = {
        schoolId
    };
    return fetch({
        url: '/school/querySchoolOwner',
        method: 'get',
        params
    });
}
//添加学校负责人
export function addSchoolOwner(schoolId, realName, phone, sIdentityId) {
    const data = {
        schoolId,
        realName,
        phone,
        sIdentityId
    };
    return fetch({
        url: '/school/addSchoolOwner',
        method: 'post',
        data
    });
}
//初始化密码
export function initializePassword(headerId, phone) {
    const data = {
        headerId,
        phone
    };
    return fetch({
        url: '/school/initializePassword',
        method: 'post',
        data
    });
}
//修改负责人
export function modifySchoolOwner(headerId, realName, phone, sIdentityId) {
    const data = {
        headerId,
        realName,
        phone,
        sIdentityId
    };
    return fetch({
        url: '/school/modifySchoolOwner',
        method: 'post',
        data
    });
}
//学校负责人禁用启用
export function permitOrForbidden(headerId, status, schoolId) {
    const data = {
        headerId,
        status,
        schoolId
    };
    return fetch({
        url: '/school/permitOrForbidden',
        method: 'post',
        data
    });
}

//根据条件分页查询学校
export function querySchoolByPage(curPage, pageSize, provinceId, cityId, areaId, schoolId, orgId, schoolType, ownerName, ownerPhone) {
    const data = {
        curPage,
        pageSize,
        provinceId,
        cityId,
        areaId,
        schoolId,
        orgId,
        schoolType,
        ownerName,
        ownerPhone
    };
    return fetch({
        url: '/school/querySchoolByPage',
        method: 'post',
        data
    });
}
//删除学校
export function batchDeleteSchool(schoolId) {
    const data = {
        schoolId
    };
    return fetch({
        url: '/school/batchDeleteSchool',
        method: 'post',
        data
    });
}

//批量删除学校轮询接口
export function batchDeleteSchoolProgress(timeStamp) {
    const data = {
        timeStamp
    };
    return fetch({
        url: '/school/batchDeleteSchoolProgress',
        method: 'post',
        data
    });
}

//删除学校负责人
export function deleteSchoolOwner(headerId, schoolId) {
    const params = {
        headerId,
        schoolId
    };
    return fetch({
        url: '/school/deleteSchoolOwner',
        method: 'get',
        params
    });
}
//根据学段查询年制
export function querySchoolYearByPeriodId(periodId) {
    const params = {
        periodId
    };
    return fetch({
        url: '/school/querySchoolYearByPeriodId',
        method: 'get',
        params
    });
}
//添加科目
export function addSubject(schoolId, subjectId) {
    const data = {
        schoolId,
        subjectId
    };
    return fetch({
        url: '/school/addSubject',
        method: 'post',
        data
    });
}
//修改前查询
export function querySchoolInfo(schoolId) {
    const params = {
        schoolId
    };
    return fetch({
        url: '/school/querySchoolInfo',
        method: 'get',
        params
    });
}